#pragma once

#include <vector>
#include <memory>
#include <string>

class EventLoop;
class EventLoopThread;

class EventLoopThreadPool {
public:
    EventLoopThreadPool(EventLoop* baseLoop, int numThreads);
    ~EventLoopThreadPool();

    void start();
    EventLoop* getNextLoop();  // 轮询获取下一个 loop

private:
    EventLoop* baseLoop_;
    int numThreads_;
    int next_;  // 下一个 loop 下标（轮询）
    std::vector<std::unique_ptr<EventLoopThread>> threads_;
    std::vector<EventLoop*> loops_;
};
